package com.weixin.paleituo.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.BasePersonActivity;
import com.weixin.paleituo.bean.MessageBean;
import com.weixin.paleituo.contans.Contans;
import com.weixin.paleituo.util.LogUtils;
import com.weixin.paleituo.util.StringUtils;
import com.weixin.paleituo.util.UIUtils;

import butterknife.BindView;

public class MessageDetailsActivity extends BasePersonActivity {

    @BindView(R.id.tv_time_activity_message_details)
    TextView mTvTimeActivityMessageDetails;
    @BindView(R.id.tv_item_title_activity_message_details)
    TextView mTvItemTitleActivityMessageDetails;
    @BindView(R.id.tv_content_activity_message_details)
    TextView mTvContentActivityMessageDetails;

    @Override
    protected View getContentView(Context context) {
        return UIUtils.inflate(this, R.layout.activity_message_details);
    }

    @Override
    protected void initData() {
        super.initData();

    MessageBean messageBean= getIntent().getParcelableExtra(Contans.INTENT_DATA);
        LogUtils.i(TAG,messageBean.toString());

        if (messageBean!=null){
            mTvTitle.setText(StringUtils.isEmpty(messageBean.getTitle())?"":messageBean.getTitle());
            mTvTimeActivityMessageDetails.setText(StringUtils.isEmpty(messageBean.getNewsTime())?"":messageBean.getNewsTime());
            mTvItemTitleActivityMessageDetails.setText(StringUtils.isEmpty(messageBean.getSummary())?"":messageBean.getSummary());
            mTvContentActivityMessageDetails.setText(StringUtils.isEmpty(messageBean.getContent())?"":messageBean.getContent());

        }

    }

    public static void startActivity(Context context, MessageBean parcelable){
        Intent intent=new Intent(context,MessageDetailsActivity.class);
        intent.putExtra(Contans.INTENT_DATA,parcelable);
        context.startActivity(intent);



    }


}
